<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button>
        显示当前时间
    </button>
    <div>某个时间</div>
    <p>1121</p>
    <script>
        //innerText和innerHtml的区别
        //innerText 不识别html标签
        //innerHTML 识别html标签
        var btn = document.querySelector('button');
        var div = document.querySelector('div');
        btn.onclick = function() {
            div.innerHTML = new Date();
        }
        var p = document.querySelector('p');
        p.innerText = Date();
    </script>
</body>

</html>